home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.2 KB | 116 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWBndShp.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWBNDSHP_H
- #define FWBNDSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR ODTransform;
-
- //========================================================================================
- // class FW_CBoundedShape
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CBoundedShape : public FW_CShape
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- protected:
- FW_CBoundedShape(const FW_CRect& rect,
- FW_ERenderVerbs renderVerb,
- const FW_PInk& ink,
- const FW_PStyle& style,
- const FW_PFont& font);
-
- FW_CBoundedShape(const FW_CBoundedShape& other);
- FW_CBoundedShape(FW_CReadableStream& archive);
-
- virtual ~ FW_CBoundedShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CBoundedShape& operator=(const FW_CBoundedShape& other);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- //----- Hit Test -----
- FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_CFixed tolerance) const;
-
- // ----- Transform -----
- virtual void Transform(Environment *ev, ODTransform* transform);
- virtual void InverseTransform(Environment *ev, ODTransform* transform);
-
- virtual void MoveShape(FW_CFixed deltaX, FW_CFixed deltaY);
- virtual void MoveShapeTo(FW_CFixed x, FW_CFixed y);
-
- virtual void Inset(FW_CFixed h, FW_CFixed v);
-
- // ----- Bounds -----
- virtual void GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
-
- // ----- Persistence -----
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void GetRectangle(FW_CRect& rect) const
- {rect = fRect;}
-
- void SetRectangle(const FW_CRect& rect)
- {fRect = rect;}
-
- void SetRectangle(FW_CFixed left, FW_CFixed top, FW_CFixed right, FW_CFixed bottom)
- {fRect.Set(left, top, right, bottom);}
-
- void SetRectangle(const FW_CPoint& topLeft, const FW_CPoint& rightBot)
- {fRect.Set(topLeft.x, topLeft.y, rightBot.x, rightBot.y);}
-
- void SetRectangle(const FW_CPoint& topLeft, FW_CFixed width, FW_CFixed height)
- {fRect.Set(topLeft, width, height);}
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- FW_CRect fRect;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-